//
//  UIView+Shadow.m
//  TMtravel
//
//  Created by sky on 17/7/25.
//  Copyright © 2017年 tmkj. All rights reserved.
//

#import "UIView+Shadow.h"

@implementation UIView (Shadow)
- (void)haveShadow {
    self.layer.shadowColor = [UIColor lightGrayColor].CGColor;
    self.layer.shadowOpacity = 0.5f;
    self.layer.shadowOffset = CGSizeMake(0,0);
}

- (void)ViweCircularBead
{
    self.layer.cornerRadius = 3;
    self.layer.masksToBounds = YES;
}

- (void)haveShadowAndCirularBead{
    self.layer.cornerRadius = 3;
    self.layer.masksToBounds = YES;
    UIView *shadowView = [[UIView alloc]initWithFrame:self.frame];
    [self.superview addSubview:shadowView];
    shadowView.layer.shadowColor = [UIColor lightGrayColor].CGColor;
    shadowView.layer.shadowOffset = CGSizeMake(0, 0);
    shadowView.layer.shadowOpacity = 0.3;
    shadowView.clipsToBounds = NO;
    [shadowView addSubview:self];
}

- (void)removeSubviews{
    for(UIView *v in self.subviews) {
        [v removeFromSuperview];
    }
}
@end
